package com.baibei.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

/**
 * Created by shenminjie on 2017/10/30.
 * mail:shenminjie@100bei.com
 */

public class RechargeAmountInfo implements Serializable, Parcelable {
    private double amount;
    private boolean isSelect;

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public RechargeAmountInfo() {
    }

    public RechargeAmountInfo(double amount) {
        this.amount = amount;
    }

    public RechargeAmountInfo(double amount, boolean isSelect) {
        this.amount = amount;
        this.isSelect = isSelect;
    }

    @Override
    public String toString() {
        return "RechargeAmountInfo{" +
                "amount=" + amount +
                ", isSelect=" + isSelect +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(this.amount);
        dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
    }

    protected RechargeAmountInfo(Parcel in) {
        this.amount = in.readDouble();
        this.isSelect = in.readByte() != 0;
    }

    public static final Parcelable.Creator<RechargeAmountInfo> CREATOR = new Parcelable.Creator<RechargeAmountInfo>() {
        @Override
        public RechargeAmountInfo createFromParcel(Parcel source) {
            return new RechargeAmountInfo(source);
        }

        @Override
        public RechargeAmountInfo[] newArray(int size) {
            return new RechargeAmountInfo[size];
        }
    };
}
